#include <cstdio>
#include <vector>
constexpr int MaxN = 1e2 + 5;
constexpr long long Mod = 1e9 + 7;
int n, k;
int plan;
long long answer;
std::vector<long long> v;
void dfs(std::vector<long long> &v, const int still)
{
    if (still == 0)
    {
        plan++;
        for (const auto &val : v)
        {
            answer += val;
            answer %= Mod;
        }
        return;
    }
    for (int i = 0; i < int(v.size()) - 1; i++)
    {
        std::vector<long long> cp = v;
        cp[i] -= cp[i + 1];
        cp.erase(cp.begin() + i + 1);
        dfs(cp, still - 1);
    }
}
long long fsp(long long x, long long y)
{
    long long res = 1;
    for (; y != 0;)
    {
        if (y & 1)
        {
            res = res * x % Mod;
        }
        y >>= 1;
        x = x * x % Mod;
    }
    return res;
}
long long inv(long long x)
{
    return fsp(x, Mod - 2);
}
int main()
{
    freopen("game.in", "r", stdin);
    freopen("game.out", "w", stdout);
    scanf("%d%d", &n, &k);
    for (int i = 1; i <= n; i++)
    {
        long long x;
        scanf("%lld", &x);
        v.push_back(x);
    }
    dfs(v, k);
    printf("%lld\n", answer * inv(plan) % Mod);
    return 0;
}
